


#pragma once

#include "CxType.h"
#include "CxMachine.h"
#include "CxGlobalVariable.h"
#include "CxUnitCard.h"
#include <vector>



BEGIN_NAMESPACE(MSG_SIGN)


using std::vector;

class CxMachine
{

	typedef vector< vector<CxUnitCard *>  >  _UnitCardGroup;
	
	typedef boost::posix_time::ptime	_Date;
	typedef std::vector<unsigned char>	_Data;

	typedef unsigned int				CardID;

public:

	CxMachine(int  nheight,int nwidth);
	~CxMachine();

public:
	void		setTime(const _Date &);
	_Date		rdTime();

	//scene handle interface 
	void		copyScene(int  ,int  ){}
	void		clearScene(int ){}

	void		setTemperature(int  ,int  ,int ,int ,int ){}
	void		setTemperatureShift(int ){}

	void		setrelySwitch(bool	){}

	void		lostpointON(){}
	bool		islosepointDetected()const{}

	void		clearpowerDectetData(){}


public:

	CxUnitCard	*findCard(size_t  cardid)
	{	
		try
		{
			return m_unitcard[cardid/m_nwidth][cardid%m_nwidth];
		}
		catch(std::exception &)
		{
			CX_ERR_MESSAGE("STDERROR")
			return NULL;
		}
	}


private:

	//	builder 
	void		buildPart();

private:

	size_t					m_cardnumber;
	size_t					m_nwidth;
	size_t					m_nheight;

	int						m_temper;
	int						m_tempershift;

	CxGlobalVariable		m_globalVar;

	//unit card
	_UnitCardGroup			m_unitcard;


};



END_NAMESPACE 